<html>
	<head>
		<title>文件上传</title>
	</head>
	<body>
		<input type="file" id="upload"/>
	</body>
	<script>
		window.onload = function() {
			var _file = document.querySelector("#upload");
            _file.addEventListener("change",function(e) {
				var fd = new FormData();
				fd.append("file",e.target.files[0]);
				var request = new XMLHttpRequest();

				request.onload = function(e) {
				    alert("上传成功");
				}
				request.open("POST","http://localhost:8888/upload/uploadFile");
				request.send(fd);
			});
		}
		
	</script>
</html>